<!-- 字符串截断 -->
<template>
  <el-tooltip placement="top" :disabled="maxLength > value.length">
    <div slot="content">{{value}}</div>
    <span>{{value | truncate({'length': maxLength})}}</span>
  </el-tooltip>
</template>

<script>
export default {
  name: 'Truncate',
  props: {
    value: {
      type: [String, Number],
      default: ' '
    },
    maxLength: {
      type: Number,
      default: 20
    }
  },
  filters: {
  }
}
</script>
